package com.sharefang.aproject.biz.ppt;

import com.sharefang.aproject.bean.PptBean;
import com.sharefang.aproject.net.RxSubscribe;
import com.sharefang.aproject.net.ServiceFactory;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import rx.Observable;

/**
 * Created by Administrator on 2016/8/15.
 */

public class PptBiz implements IPptBiz {


    @Override
    public void getPpt(boolean loadMore, int offset, final OnPptResultListener listener) {
        Map<String, Object> map = new HashMap<>();
        map.put("page", 1);
        map.put("offset", offset);
        map.put("limit", 10);

        Observable<List<PptBean>> observable = ServiceFactory.INSTANCE.getPpt("", map);
        observable.subscribe(new RxSubscribe<List<PptBean>>() {
            @Override
            protected void _onNext(List<PptBean> pptBeen) {
                listener.onSuccess(pptBeen);
            }

            @Override
            protected void _onError(String message) {
                listener.onFailure(message);
            }
        });
    }
}
